//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  GameOverViewController.m
//  PokerHandUp
//
//  Created by psvn047 on 6/18/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#import "GameOverViewController.h"
#import "GameViewController.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@interface GameOverViewController ()

@end
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@implementation GameOverViewController
@synthesize gameOverDelegateCallback = _gameOverDelegateCallback;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// change messgae
-(void) changeMessage:(NSString*) message
{
    lblMessage.text = message;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization

    }
    return self;
}
-(IBAction) nextRoundHdl:(id)sender
{
    [btnNext setHidden:YES];
    [self.view setAlpha:0.0f];
    [self.gameOverDelegateCallback endRoundAnimationCallback];
}
-(void) showEndRoundAnimation
{
    [self.view setAlpha:0.0f];
    [self.view setHidden:NO];
    [UIView animateWithDuration:1 delay:0.0f options:UIViewAnimationCurveEaseIn
                     animations:^{
                         [self.view setAlpha:1.0f];
                      
                     }             
                     completion:^(BOOL finished) {
                         [UIView animateWithDuration:1 delay:0.0f options:UIViewAnimationCurveEaseIn
                                          animations:^{
                                              //[self.view setAlpha:0.0f];
                                              
                                          }             
                                          completion:^(BOOL finished) {
                                              if([[GameViewController share] autoplay]) 
                                              {
                                                  [btnNext setHidden:YES];
                                                  [self.gameOverDelegateCallback endRoundAnimationCallback];
                                              }
                                              else
                                              {
                                                   [btnNext setHidden:NO];
                                              }
                                          }
                          ];

                     }
     ];
     
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [btnNext setHidden:YES];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
